<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "kd_admin".
 *
 * @property integer $user_id
 * @property string $user_name
 * @property string $password
 */
class Admin extends \yii\db\ActiveRecord
{
    public function beHaviors(){
        return [
            [
                'class' => \app\components\behaviors\LogBehavior::className(),
                'tableName' => '超级管理员',
                'attributeValue' => 'user_name',
            ],
        ];
    }
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'kd_admin';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['user_name', 'password'], 'required'],
            [['user_name', 'password'], 'string', 'max' => 50],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'user_id' => '管理员id',
            'user_name' => '管理员名称',
            'password' => '管理员密码',
        ];
    }
}
